import { Body, Controller, Post } from '@nestjs/common'
import { WarehouseService } from './warehouse.service'

@Controller('warehouse')
export class WarehouseController {
  constructor(private readonly warehouseService: WarehouseService) { }

  @Post('add')
  add(@Body() body) {
    return this.warehouseService.add(body)
  }

  @Post('del')
  del(@Body() body) {
    return this.warehouseService.del(body.id as number)
  }

  @Post('edit')
  edit(@Body() body) {
    return this.warehouseService.update(body)
  }

  @Post('page')
  page(@Body() body) {
    return this.warehouseService.getPageList(body)
  }

  @Post('getWarehouseList')
  getWarehouseList() {
    return this.warehouseService.getWarehouseList()
  }
}
